<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/1
 * Time: 16:04
 */

namespace userinfo;

use userinfo\user\user;
use userinfo\user\vip1;
use userinfo\user\vip2;

require 'userinfo\user.php';
require 'userinfo\vip1.php';
require 'userinfo\vip2.php';


class manager
{
    public $arr = [];

    public function cs(){
//        $user1 = new user();
//        $user2 = new user();
//        $vip1 = new vip1();
//        $user1->mylevel();
//        $vip1->mylevel();
//        self::usernum();
        $this->arr[] = $this->creuser(0);
        $this->arr[] = $this->creuser(1);
        $this->arr[] = $this->creuser(2);
    }
    public function creuser($level){
        $user=null;
        switch ($level){
            case 0:
                $user = new user();
                break;
            case 1:
                $user = new vip1();
                break;
            case 2:
                $user = new vip2();
                break;
            default:
                echo '没有该用户类型';
                break;
        }
        $user->mylevel();
        $this->usernum();
        return $user;
    }
    public static function usernum(){
        echo '<br />在线人数： ' . user::getOnlineNum() . '<br />';
    }

}
$manager = new manager();
$manager->cs();



